﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using WorldSource.Entities;
namespace WorldSource
{
    public class InputHandler
    {
        public MouseState mouseState;
        public MouseState prevMouseState;
        public KeyboardState keyBoardState;
        public KeyboardState prevKeyBoardState;

        public void Update(GameTime gameTime)
        {
            if (keyBoardState.IsKeyDown(Keys.W))
            {
                Game1.player.movementVector.Y -= 1.0f * (float)gameTime.TotalGameTime.TotalSeconds;
            }
            else if (keyBoardState.IsKeyDown(Keys.S))
            {
                Game1.player.movementVector.Y += 1.0f * (float)gameTime.TotalGameTime.TotalSeconds;
            }

            if (keyBoardState.IsKeyDown(Keys.A))
            {
                Game1.player.movementVector.X -= 1.0f * (float)gameTime.TotalGameTime.TotalSeconds;
            }
            else if (keyBoardState.IsKeyDown(Keys.D))
            {
                Game1.player.movementVector.X += 1.0f * (float)gameTime.TotalGameTime.TotalSeconds;
            }
        }
    }
}
